# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-easyprocess
pkgname=('python2-easyprocess' 'python-easyprocess')
_pkgname=EasyProcess
pkgver=1.1
pkgrel=4
pkgdesc='Easy to use python subprocess interface.'
arch=('any')
url='https://pypi.python.org/pypi/easyprocess/'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/EasyProcess-$pkgver.tar.gz")
sha512sums=('ca47bbdf81901fc1b907dff5a0f1797586d47d008722b34072584785485eacc8a35c66f14bac64411b12ff39fa6c9a4684d3b299fbb11d68396820b97903a53e')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-easyprocess() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-easyprocess() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

